package cn.melonlib.nars.record.model.entity;

import cn.melonlib.cores.commons.model.entity.TenantRecordEntity;
import cn.melonlib.cores.model.anno.ModelComment;
import cn.melonlib.nars.record.model.enums.OperatorType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;

import javax.persistence.*;

@Data
@EqualsAndHashCode(callSuper = true)
@ModelComment("用户访问日志")
@Entity(name = "NamesVisitorRecord")
@Table(name = "nars_names_visitor_record")
public class NamesVisitorRecord extends TenantRecordEntity {
    @ModelComment(value = "资源ID",required = true)
    @Column
    @Lob
    @Basic(fetch = FetchType.LAZY)@Type(type = "org.hibernate.type.TextType")
    private String namesId;

    @ModelComment("操作用户的IP地址")
    private String ip;

    @ModelComment("操作详细信息，包括操作系统、浏览器信息、网络信息等等")
    @Column@Lob@Basic(fetch = FetchType.LAZY)@Type(type = "org.hibernate.type.TextType")
    private String body;
}
